package org.example.Interceptors;

import lombok.extern.slf4j.Slf4j;
import org.example.common.ApiResponse;
import org.example.common.TokenStorage;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Enumeration;
import java.util.List;

/**
 * @Description
 * @Author 魏锴
 * @Date 2024/1/15
 */
@Slf4j
public class AvatarInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {    //此处判断session会话当中是否存在localUser
        if ("OPTIONS".equals(request.getMethod())) return true;
        System.out.println("<------ 头像上传校验开始 ------>");
        String token = TokenStorage.getToken();//获取token

        return false;
    }
}
